cmake_minimum_required(VERSION 3.14)
project(HeatBeatServer)

set(CMAKE_CXX_STANDARD 17)
set(muduo_lib_path /mnt/muduo_debug/-debug-cpp11/lib)
set(muduo_include_path /mnt/muduo_debug/-debug-cpp11/)
set(BOOST_LIBRARYDIR /usr/local/lib/boost)
#nlohmann_json库路径
set(nlohmann_json_path ${CMAKE_CURRENT_SOURCE_DIR}/nlohmann)

find_package(Boost COMPONENTS system filesystem REQUIRED)

add_executable(HeatBeatServer main.cpp Server.cpp Server.h PackHandle.cpp PackHandle.h User.cpp User.h UserMgr.cpp UserMgr.h Room.cpp Room.h RoomMgr.cpp RoomMgr.h CommonFunction.cpp CommonFunction.h JsonProtocol.cpp JsonProtocol.h ProtocolNoDefine.h MakePacket.cpp MakePacket.h)

# 设置动态库 静态库路径
target_include_directories(HeatBeatServer PRIVATE ${muduo_include_path})
target_include_directories(HeatBeatServer PRIVATE ${nlohmann_json_path})

#设置连接库默认路径
target_link_directories(HeatBeatServer PUBLIC ${muduo_lib_path})
target_link_libraries(HeatBeatServer muduo_base muduo_http muduo_inspect muduo_net muduo_pubsub)
target_link_libraries(HeatBeatServer -lpthread)

target_link_libraries(HeatBeatServer ${Boost_LIBRARIES})